package xyx.ssm.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import xyx.ssm.model.User;
import xyx.ssm.service.UserService;

import java.util.List;

@Controller
@RequestMapping("/ssm")
@Api(tags = {"测试2"},description = "swagger2测试2")
public class UserController {
    @Autowired
    UserService userService;

    @ApiOperation(value = "查询",notes = "查询所有用户")
    @ApiResponses(value = { @ApiResponse(code = 200, message = "查询用户成功")})
    @GetMapping(value = "/index")
    public String index(){
        List<User> user = userService.selectUser();
        System.out.print(user);
        return "index";
    }
}